/**
 * Created by shauan on 04/09/14.
 */

$(function(){
    UPLOAD.inputFile();
    $('#sendform').click(function(){
        $.ajax({
            type: 'post',
            url: 'uploadFile',
            cache:false,
            contentType:false,
            processData:false,
            data:UPLOAD.dadosForm(),
            beforeSend: function () {},
            success: function (result) {
                $('input[name="foto"]').val('');
            },
            error: function () {
                alert("Error");
                return false;
            },
            complete: function () {
                $('form[name="User"]').submit();
            }
        });
        return false;
    });
});
